<extend name="Public/base" />

<block name="body">
    <form method="POST" id="refundlist" action="{:U('Report/refundExport')}">
        <!-- 标题栏 -->
        <div class="main-title">
            <h2>
                线上水果销售报表
                <a onclick="onlineSalesExport();" class="btn confirm btn-default">当月数据excel导出</a>
            </h2>
        </div>
        
        <div class="navbar navbar-default" style="margin: 0px;">
         
            <!-- 高级搜索 -->
            <div class="search-form " style="margin-top: 10px;margin-left: 10px;">
                <div class="sleft">
                   统计日期：<input type="text" name="report_day" class="text input-large time" value="{$report_day}" placeholder="请选择统计日期"   style="height: 30px;width:160px" />
                </div>
                <div class="sleft">
                    <a class="sch-btn" href="javascript:;" id="search" url="{:U('onlineSales')}"><i class="btn-search"></i></a>
                </div>
            </div>
        </div>
       
        <!-- 数据列表 -->
        <div class="data-table table-striped">
            <table class="table table-hover">
                <thead>
                    <tr>           
                        <th>统计日期</th>
                        <th>产品名称</th>
                        <th>订单数</th>
                        <th>金额</th>
                        <th>订单用户数</th>
                    </tr>
                </thead>
                <tbody>
                <notempty name="_list">
                    <volist name="_list" id="vo">
                        <tr  valign="top">
                            <td>{$vo.report_day} </td>
                            <td>{$vo.name} </td>
                            <td>{$vo.o_cnt} </td>	
                            <td>{$vo.total} </td>
                            <td>{$vo.u_cnt} </td>
                        </tr>
                    </volist>
                    <else/>
                    <td colspan="12" class="text-center"> aOh! 暂时还没有内容! </td>
                </notempty>
            </table>
        </div>
        <div class="page">
            {$_page}
        </div>
    </form>
</block>

<block name="script">
    <script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>
    <link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
    <php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
    <link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
    <script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
    <script type="text/javascript">
        //搜索功能
        $("#search").click(function () {
            var url = $(this).attr('url');

            var query = $('.search-form').find('input').serialize();

            query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
            query = query.replace(/^&/g, '');

            if (url.indexOf('?') > 0) {
                url += '&' + query;
            } else {
                url += '?' + query;
            }

            window.location.href = url;
        });
        //回车搜索
        $(".search-input").keyup(function (e) {
            if (e.keyCode === 13) {
                $("#search").click();
                return false;
            }
        });
        //导航高亮
        highlight_subnav('{:U('Report/onlineSales')}');

        $(function () {
            $('.time').datetimepicker({
                format: 'yyyy-mm-dd',
                language: "zh-CN",
                minView: 2,
                autoclose: true
            });
        });
        
        function onlineSalesExport(){
            $('#onlineSales').submit();
        }
    </script>
</block>
